import { request, withCancelToken } from '@/utils/request'

const category = (data) => {
  return request(
    '/category',
    {
      method: 'get',
      params: {
        ...data
      }
    }
  )
}

const banner = () => {
  return request('/home/banner',{
    method: 'get',
    params: {
      distributionSite: 2
    }
  })
}

const filter = (data) => {
  return request('/category/sub/filter', {
    method: 'get',
    params: {
      ...data
    }
  })
}

const [ categorySend ] = withCancelToken(category)
const [ bannerSend ] =withCancelToken(banner)
const [filterSend] = withCancelToken(filter)

export { categorySend,bannerSend,filterSend }